<!doctype html>
<html><head>
	<meta charset="utf-8">
	<title>详情</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<!-- jQuery-->
	<script type="text/javascript" src="/static/plugins/jquery/jquery-3.6.0.min.js"></script>
	
	<!-- layui-->
	<link rel="stylesheet" href="/static/plugins/layui/2.7.6/css/layui.css" media="all">
	<script src="/static/plugins/layui/2.7.6/layui.js" charset="utf-8"></script>
	
	<!-- common -->
	<link rel="stylesheet" href="/static/admin/css/common.css" media="all" />
	<script type="text/javascript" src="/static/admin/js/common-grid.js?v=c"></script>
	<link rel="stylesheet" href="/static/admin/css/mini-ease.css" media="all" />
	
	<!-- iconfont -->
	<link rel="stylesheet" href="/static/css/icon/iconfont.css" media="all" />

	<!-- 页面js
	<script type="text/javascript" src="/static/js/business/tpAmazonAnalysis/tpAmazonAnalysis.js?v=c"></script>
	-->
</head>
<body style="padding: 10px 0 0 10px;">
	<!-- 搜索面板【start】 -->

	<!-- 搜索面板【end】 -->
	
	<div class="layui-row layui-col-space5">
		<!-- 左边面板【start】 -->
		<div class="layui-col-md12" id="id_panel_left_grid">
			<div class="layui-panel" style="overflow: auto; padding-top: 0.2rem;">
				<div class="mid-content">

					<table class="layui-hide" id="main_table" lay-filter="main_table">

					</table>

	<script type="text/html" id="templet_index_no">
	{{d.LAY_TABLE_INDEX+1}}
	</script>


	
	<script type="text/html" id="templet_script_name">
	{{d.info}}
	</script>


                                    <script th:inline="javascript">

                                        layui
                                                .extend({optimizeSelectOption: '/static/plugins/layui/extends/optimizeSelectOption/optimizeSelectOption'})
                                                .use(['form', 'element', 'table', 'dropdown', 'optimizeSelectOption', 'util', 'laydate'], function(){
                                                    var element = layui.element;
                                                    var table = layui.table;
                                                    var dropdown = layui.dropdown;
                                                    var form = layui.form;
                                                    var util = layui.util;
                                                    var $ = layui.jquery;
                                                    var laydate = layui.laydate;
                                                    var cols =[ //表头
                                                        //以下是一级表头
                                                        [
                                                            {title: '序号',  align:"center",type:"numbers"}
                                                            ,{title: '状态', field:'infoType', align:"center"}
                                                            ,{title: '单号', field:'code', align:"center"}
                                                            ,{title: '开始时间', field:'beginTime', align:"center"}
                                                            ,{title: '结束时间', field:'endTime', align:"center"}
                                                            ,{title: '超时天数', field:'overDay', align:"center"}
                                                            ,{title: '运营公司简称', field:'VGsJc', align:"center"}
                                                            ,{title: '运营公司编码', field:'VGsBm', align:"center"}
                                                            ,{title: '运营人', field:'UserName', align:"center"}
                                                            ,{title: '运营人账号', field:'UserId', align:"center"}
                                                            ,{title: '运营人部门', field:'DeptName', align:"center"}

                                                        ]
                                                    ];

                                                    // 创建渲染实例
                                                    table.render({
                                                        elem: '#main_table',//表id
                                                        url:'/web/business/tpTimeCheck/getTimeCheckDetailList', // 获取数据接口
                                                        toolbar: '#toolbarDemo',//开启表格头部工具栏
                                                        //设置头部工具栏右侧图标
                                                        defaultToolbar: ['filter', 'print', {
                                                            title: '导出数据'
                                                            ,layEvent: 'LAYTABLE_EXPORT_DATA'
                                                            ,icon: 'layui-icon-export'
                                                        }, {
                                                            title: '刷新页面'
                                                            ,layEvent: 'LAYTABLE_REFRESH'
                                                            ,icon: 'layui-icon-refresh'
                                                        }],
                                                        height: window.innerHeight - 140, // 最大高度减去其他容器已占有的高度差
                                                        limit : 20,//每页显示的条数
                                                        limits : [20,50,200,500],//每页显示的条数
                                                        where: getConds(),
                                                        cellMinWidth: 95,//设置所有普通单元格的最小宽度
                                                        //totalRow: true, // 开启合计行，true开启，false关闭
                                                        page: true,//开启分页
                                                        request: {//对默认的分页相关的请求参数
                                                            pageName: 'page',
                                                            limitName: 'size'
                                                        },
                                                        skin: 'grid',//设置表格边框风格
                                                        even: true, // 开启隔行背景
                                                        //表头属性集
                                                        cols: cols,

                                                        //数据格式解析的回调函数
                                                        /*
                                                        parseData: function(res){ // res 即为原始返回的数据
                                                            console.log('res：',res);
                                                            var resDate = res.data;
                                                            console.log('运营数据：',resDate);
                                                            var tableDate = setList(resDate,dateList);
                                                            console.log('整合后的：',tableDate);

                                                            return {
                                                                "code": res.code, // 解析接口状态
                                                                "msg": res.msg, // 解析提示文本
                                                                "count": res.count, // 解析数据长度
                                                                "data": tableDate // 解析数据列表
                                                            };
                                                        },
                                                        */
                                                        //数据渲染完毕的回调函数
                                                        done: function(res){
                                                            console.log('详情返回res：',res);
                                                            // 绑定查询按钮--表格重载成功后
                                                            $('#id_filter_form_search').on('click', function(e){
                                                                layui.table.reload("main_table",{
                                                                    page: {
                                                                        curr: 1
                                                                    },
                                                                    where: getConds()
                                                                })
                                                            });
                                                        },
                                                        error: function(res, msg){
                                                            console.log(res, msg)
                                                        }
                                                    });
                                                    // 工具栏事件
                                                    table.on('toolbar(main_table)', function(obj){
                                                        var id = obj.config.id;
                                                        var checkStatus = table.checkStatus(id);
                                                        var othis = lay(this);
                                                        switch(obj.event){
                                                            case 'LAYTABLE_REFRESH':
                                                            {
                                                                layer.confirm("确定刷新吗？",{
                                                                    btn: ['确定', '取消']
                                                                }, function (index) {
                                                                    location.reload();
                                                                    layer.close(index);
                                                                });
                                                                break;
                                                            }
                                                            case 'LAYTABLE_EXPORT_DATA'://导出
                                                            {
                                                                $.ajax({
                                                                    type: "POST",
                                                                    url: '/web/business/tpTimeCheck/exportDetail',
                                                                    data: getConds(),
                                                                    success: function (data) {
                                                                        if (data.code == 0) {
                                                                            if(data.msg != undefined && data.msg.startsWith('http')) {
                                                                                window.open(data.msg);
                                                                            } else {
                                                                                layer.msg(data.msg);
                                                                            }
                                                                        } else {
                                                                            alert(data.msg);
                                                                        }
                                                                    }
                                                                });
                                                                break;
                                                            }
                                                        };
                                                    });
                                                    // 清空按钮
                                                    form.on('submit(filter_form_search_clear)', function(data){
                                                        layer.confirm("确定清空搜索条件吗？",{
                                                            btn: ['确定', '取消']
                                                        }, function (index) {
                                                            $('form[name="searchForm"]').find('input[type=text],select').each(function() {
                                                                $(this).val('');
                                                            });
                                                            layer.close(index);
                                                        });
                                                        return false;
                                                    });
                                                });
                                        $('body').on("mouseenter",".layui-table-body tr",function () {
                                            $(this).siblings().find("div").css("color","#142A48");
                                            $(this).find("div").css("color","#4DA1FF");
                                        });
										//搜索
										function getConds() {
											var conditions = [];
											$(".bo-search-field").each(function(index, dom){
												var value = $(this).val();
												if (value != '') {
													conditions.push({'rangeType':$(this).attr('cond-range-type'), 'value': value, 'field':$(this).attr('name')});
												}
											});
											$(".bo-search-field-selector").each(function(index, dom){
												var value = $(this).val();
												if (value != '') {
													conditions.push({'rangeType':'t_system', 'value': value, 'field':$(this).attr('name')});
												}
											});
											return {'conditions': JSON.stringify(conditions)};
										}


                                    </script>
                                </div>
                            </div>
                        </div>
                        <!-- 左边面板【end】 -->
		
	</div>
	
	<script type="text/javascript">
	$(function() {
		$('#id_panel_left_grid').css('height', (window.innerHeight - 140) + 'px');
	});
	</script>

</body>
		
</html>